package com.rattsoftware.server.dao;

import java.util.List;

import com.rattsoftware.server.admin.model.Course;
import com.rattsoftware.server.admin.model.paging.PagingLoadConfig;
import com.rattsoftware.server.admin.model.paging.PagingLoadResult;

/**
 * Provides data access 
 * services to the <code>Course service</code>.
 * 
 *
 */
public interface CourseDAO extends BaseDAO<Course> {
	
	/**
	 * Gets a list of courses in the database.
	 * 
	 * @return the course list.
	 */
	List<Course> getCourses();
	
	/**
	 * Retrieves course by identifier
	 * 
	 * @param id Integer 
	 * @return Course, or null if no match found
	 */
	Course getCourse(Integer id);
	
	/**
	 * Saves a course to the database.
	 * 
	 * @param course the course to save.
	 */
	void saveCourse(Course course);
	
	/**
	 * Removes a course from the database.
	 * 
	 * @param course the course to remove.
	 * 
	 */
	void deleteCourse(Course course);
	
	/**
	 * Retrieves a page of the course data.
	 * 
	 * @param pagingLoadConfig
	 *            config to specify paging related config
	 * @return PagingLoadResult containing a page of course data
	 */
	PagingLoadResult<Course> getCourseList(PagingLoadConfig pagingLoadConfig);
	
	/**
	 * Retrieves a page of the course data that belongs to a given department.
	 * 
	 * @param deptId
	 *            Integer
	 * @param pagingLoadConfig
	 *            config to specify paging related config
	 * @return PagingLoadResult containing a page of course data
	 */
	PagingLoadResult<Course> getCourseList(Integer deptId, PagingLoadConfig pagingLoadConfig);
}
